--------------------------------------------------------------------------------
-- \file     hdr.lua
-- \brief    Outputs file header / footer
-- \version  1
-- \date     2013-03-11 8:51AM
-- \author   ACV
--------------------------------------------------------------------------------

file_start = [[
//------------------------------------------------------------------------------
// \file     %s
// \brief    Brief description
// \version
// \date     %s
// \author   %s
// $Id: mkcfile.lua 172 2013-03-12 07:43:42Z ac.verbeck@gmail.com $
//------------------------------------------------------------------------------

]]

copyright = [[
//------------------------------------------------------------------------------
//	Copyright and Disclaimer Notice
//
//	Copyright (c) 2013 A.C. Verbeck
//
//	This file is part of %s.
//
//	%s is free software: you can redistribute it and/or modify
//	it under the terms of the GNU General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	%s is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU General Public License for more details.
//
//	You should have received a copy of the GNU General Public License
//	along with %s.  If not, see <http://www.gnu.org/licenses/>.
//
//------------------------------------------------------------------------------

]]

file_end = [[
//
//	End: %s
//
]]

function prt_hdr(f)
	curr_file = f
	curr_date = os.date("%Y-%m-%d %X")
	curr_user = os.getenv("USERNAME")
	ps = "SM"
	pl = "SM: A State Machine Library"

	io.write(string.format(file_start, curr_file, curr_date, curr_user))
	io.write(string.format(copyright, pl, ps, ps, ps))
	io.write(string.format(file_end, curr_file))
end

io.output(arg[1])
prt_hdr(arg[1])
io.close()

--
--	End: hdr.lua
--
